<?php


namespace app\api\controller\v1;
use app\api\service\jingdong\JingDongOrderService;
use think\Request;

class JingDongOrder
{
    /**
     * @var JingDongGoods
     */
    private $JingDongOrderService;

    /**
     * JingDongGoods constructor.
     */
    public function __construct()
    {
        $this->JingDongOrderService = JingDongOrderService::getInstance();
    }
    /**
     * 开普勒-订单创建
     */
    public function submitOrder()
    {
        $attributes['invoiceType']  =   3;
        $list   =   $this->JingDongOrderService->submitOrder($attributes);
        return writeJson(200,$list);
    }
    /**
     * 开普勒-订单取消
     */
    public function cancelOrder(Request $request)
    {
        $param  =   $request->post();
        $result   =   $this->JingDongOrderService->cancelOrder($param);
        return writeJson(200,$result);
    }
    /**
     * 开普勒-订单确认收获
     */
    public function confirmDelivery(Request $request)
    {
        $param  =   $request->post();
        $result   =   $this->JingDongOrderService->confirmDelivery($param);
        return writeJson(200,$result);
    }
}